﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using Interfaces;
using Insteon;
using Scheduling;

namespace Mesne
{
    [ServiceContract(SessionMode = SessionMode.Required, CallbackContract=typeof(IClientCallback))]
    [ServiceKnownType(typeof(Device))]
    [ServiceKnownType(typeof(Command))]
    [ServiceKnownType(typeof(TimeSpec))]
    [ServiceKnownType(typeof(Operation))]
    [ServiceKnownType(typeof(List<Device>))]
    [ServiceKnownType(typeof(List<Command>))]
    [ServiceKnownType(typeof(List<Operation>))]
    public interface IServiceContract
    {
        [OperationContract(IsOneWay=false)]
        void SendMessage(ICommand command);

        [OperationContract(IsOneWay=false)]
        bool ScheduleOperation(IOperation operation);

        [OperationContract(IsOneWay = false)]
        bool ScheduleOperations(List<IOperation> operation);

        [OperationContract(IsOneWay = false)]
        bool DeleteOperation(string name);

        [OperationContract(IsOneWay = false)]
        bool DeleteOperations(List<string> names);

        [OperationContract(IsOneWay = false)]
        bool DeleteAllOperations();


        [OperationContract(IsOneWay = false)]
        string GetConfig();

        [OperationContract(IsOneWay=false)]
        bool EstablishCallback();

        [OperationContract(IsOneWay = false)]
        List<IDevice> GetDevices();

        [OperationContract(IsOneWay = false)]
        List<IOperation> GetOperations();

        [OperationContract(IsOneWay = true, IsTerminating = true)]
        void Disconnect();
    }
}
